﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Web.control
{
    public partial class DateSelect : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            // Put user code to initialize the page here
            string scriptStr = "javascript:return popUpCalendar(this," + getClientID() + @", 'mm/dd/yyyy', '__doPostBack(\'" + getClientID() + @"\')')";
            imgCalendar.Attributes.Add("onclick", scriptStr);
        }


        // Get the id of the control rendered on client side
        // Very essential for Javascript Calendar scripts to locate the textbox
        public string getClientID()
        {
            return txt_Date.ClientID;
        }

        // This propery sets/gets the calendar date
        public string CalendarDate
        {
            get
            {
                return txt_Date.Text;
            }
            set
            {
                txt_Date.Text = value;
            }
        }
    }
}